package com.ssh;

import org.junit.Test;

public class IsSubsequence_392 {
	public boolean isSubsequence(String s, String t) {
		int i = 0,j = 0;
	    while (i < s.length() && j < t.length()) {
	    	 if (s.charAt(i) == t.charAt(j)) {
	    		 i++;
	    	 } 
	    	 j++;
	    }  
	    return i == s.length();
	}
	
	
	@Test
	public void test() {
		System.out.println(isSubsequence("abc", "addsbdc"));
	}
}
